package by.semerikov.parser;

import by.semerikov.parts.Date;

public class DateLineParser implements IStringParser<Date> {

	@Override
	public Date getObject(String line) {
		Date result = new Date();
		String[] array = line.split("/");
		result.setDay(Integer.parseInt(array[0]));
		result.setMonth(Integer.parseInt(array[1]));
		String[] array2 = array[2].split(":");
		result.setYear(Integer.parseInt(array2[0]));
		result.setHour(Integer.parseInt(array2[1]));
		result.setMinute(Integer.parseInt(array2[2]));
		result.setSecond(Integer.parseInt(array2[3]));
		return result;
	}

}
